varying vec3 v_position;

uniform vec3 city_color;
uniform vec3 u_head_color;
uniform float u_size;

uniform float up_height;
uniform float up_height_section;
uniform vec3 u_up_color;

uniform float move_line;
uniform float move_line_section;
uniform vec3 u_move_line_color;

void main() {
    vec3 base_color = mix(city_color, u_head_color, v_position.z / u_size);
    if(v_position.z > up_height && v_position.z < up_height + up_height_section) {
        float tempS = up_height_section / 2.0;
        float scale = (v_position.z - up_height - tempS) / tempS;
        base_color = mix(u_up_color, base_color, abs(scale));
    }
    if(v_position.x > move_line && v_position.x < move_line + move_line_section) {
        float tempS = move_line_section / 2.0;
        float scale = (v_position.x - move_line - tempS) / tempS;
        base_color = mix(u_move_line_color, base_color, abs(scale));
    }
    gl_FragColor = vec4(base_color, 1.0);

    // gl_FragColor = vec4(city_color.r,city_color.g,city_color.b * v_position.z/u_size,1.0);
}